﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using DAO;
using DTO;

namespace BUS
{
    public class ChiTietChuyenBay_BUS
    {
        public static List<ChiTietChuyenBay_DTO> GetChiTietChuyenBayList()
        {
            List<ChiTietChuyenBay_DTO> listChiTietChuyenBay = new List<ChiTietChuyenBay_DTO>();
            try
            {
                ChiTietChuyenBay_DAO chuyenbayDAO = new ChiTietChuyenBay_DAO();
                listChiTietChuyenBay = chuyenbayDAO.GetChiTietChuyenBayList();
            }
            catch (System.Exception)
            {

            }
            return listChiTietChuyenBay;
        }

        public static BindingList<ChiTietChuyenBay_DTO> GetChiTietChuyenBayDetails(string mMaChuyenBay)
        {
            BindingList<ChiTietChuyenBay_DTO> listchitietChuyenBayDTO = new BindingList<ChiTietChuyenBay_DTO>();
            try
            {
                ChiTietChuyenBay_DAO chitietchuyenbayDAO = new ChiTietChuyenBay_DAO();
                listchitietChuyenBayDTO = chitietchuyenbayDAO.GetChiTietChuyenBayDetails(mMaChuyenBay);
            }
            catch (System.Exception)
            {
            }
            return listchitietChuyenBayDTO;
        }

        public static string MaxMaChiTietChuyenBay()
        {
            return ChiTietChuyenBay_DAO.MaChiTietChuyenBayMax();
        }

        public static void InsertChiTietChuyenBay(ChiTietChuyenBay_DTO chitietchuyenbayDTO)
        {
            try
            {
                ChiTietChuyenBay_DAO chitietchuyenbayDAO = new ChiTietChuyenBay_DAO();
                chitietchuyenbayDAO.InsertChiTietChuyenBay(chitietchuyenbayDTO);
            }
            catch
            { }
        }

        public static void UpdateChiTietChuyenBay(ChiTietChuyenBay_DTO chitietchuyenbayDTO)
        {
            try
            {
                ChiTietChuyenBay_DAO chitietchuyenbayDAO = new ChiTietChuyenBay_DAO();
                chitietchuyenbayDAO.UpdateChiTiet(chitietchuyenbayDTO);
            }
            catch
            { }
        }

        public static void DeleteChiTietChuyenBay(ChiTietChuyenBay_DTO chitietchuyenbayDTO)
        {
            try
            {
                ChiTietChuyenBay_DAO chitietchuyenbayDAO = new ChiTietChuyenBay_DAO();
                chitietchuyenbayDAO.DeleteChiTiet(chitietchuyenbayDTO);
            }
            catch
            { }
        }

        public static void InsertNhieuChiTiet(BindingList<ChiTietChuyenBay_DTO> listChiTiet)
        {
            try
            {
                ChiTietChuyenBay_DAO chitietDAO = new ChiTietChuyenBay_DAO();
                chitietDAO.InsertNhieuChiTiet(listChiTiet);
            }
            catch
            { }
        }
    }
}
